package com.kvest.fortests.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.widget.DrawerLayout;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import com.kvest.fortests.R;

/**
 * Created with IntelliJ IDEA.
 * User: Kvest
 * Date: 23.08.13
 * Time: 22:31
 * To change this template use File | Settings | File Templates.
 */
public class NavigationDrawerFragment extends Fragment {
    ;private DrawerLayout mDrawerLayout;
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.navigation_drawer_fragment, null);

        mDrawerLayout = (DrawerLayout) view.findViewById(R.id.drawer_layout);

        ListView mDrawerList = (ListView) view.findViewById(R.id.left_drawer);
        // Set the adapter for the list view
        mDrawerList.setAdapter(new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, new String[]{"Item1", "Item2", "Item3", "Item4"}));

        view.findViewById(R.id.open).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mDrawerLayout.openDrawer(Gravity.LEFT);
            }
        });

        return view;
    }
}
